home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / n_b_v203.zip / GET-PUTP.DMO < prev    next >
Text File  |  1996-07-04  |  4KB  |  67 lines

  1. $if 0
  2.     ┌──────────────────────────╖                        PowerBASIC v3.20
  3.  ┌──┤          DASoft          ╟──────────────────────┬──────────────────╖
  4.  │  ├──────────────────────────╢    Copyright 1995    │ DATE: 1995-10-01 ╟─╖
  5.  │  │ FILE NAME   GET-PUTP.DMO ║          by          ╘════════════════─ ║ ║
  6.  │  │                          ║  Don Schullian, Jr.                     ║ ║
  7.  │  ╘══════════════════════════╝                                         ║ ║
  8.  │ A license is hereby granted to the holder to use this source code in  ║ ║
  9.  │ any program, commercial or otherwise,  without receiving the express  ║ ║
  10.  │ permission of the copyright holder and without paying any royalties,  ║ ║
  11.  │ as long as this code is not distributed in any compilable format.     ║ ║
  12.  │  IE: source code files, PowerBASIC Unit files, and printed listings   ║ ║
  13.  ╘═╤═════════════════════════════════════════════════════════════════════╝ ║
  14.    │                ....................................                   ║
  15.    ╘═══════════════════════════════════════════════════════════════════════╝
  16. $endif
  17.  
  18. '.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
  19. ' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
  20. $INCLUDE "DAS-NBV1.INC"
  21. CLS
  22. SCREEN 12
  23. CLS
  24. GraphicSETUP
  25.  
  26. ? "┌───────────────────────────────────────────────────────────────────────
  27. ? "│ fGetParr?? ( C1%, R1%, C2%, R2%, ANYnumber, Plane? )
  28. ? "│  PutParr   ( C1%, R1%, ANYnumber, Pmode?, Plane? )
  29. ? "├───────────────────────────────────────────────────────────────────────
  30. ? "│ Like the GET and PUT statements in PowerBASIC except that they work on
  31. ? "│ a single plane of the graphics screen to store the <monochrome> image
  32. ? "│ stored there. What you do with the data after that is limited only to
  33. ? "│ your immagination.
  34. ? "│ SEE the internal help screens for full details on fGetXxxx and PutXxxx
  35. ? "└───────────────────────────────────────────────────────────────────────
  36.                                                 '┌───────────────────────────
  37. C1% =   0  :  C2% =  99                         '│ box coordinates
  38. R1% = 250  :  R2% = 349                         '│
  39. C? = 1                                          '│ starting color (plane 0)
  40. DO                                              '│
  41.   GBoxDRAW C1%, R1%, C2%, R2%, 0, 3, C?         '│ draw a box
  42.   INCR C1%, 15 : DECR C2%, 15                   '│ decr box size
  43.   INCR R1%, 15 : DECR R2%, 15                   '│
  44.   INCR C?, C?                                   '│ colors = 1, 2, 4, 8
  45. LOOP UNTIL C? > 8                               '│ planes = 0, 1, 2, 3
  46.                                                 '│
  47. Size% = fBMPwords%( 100, 100 )                  '│ create a buffer for data
  48. DIM Buf%( Size% )                               '│
  49. Buf_Ptr??? = VARPTR32( Buf%(0) )                '│ 32bit pointer works too
  50.                                                 '│
  51. DELAY 1                                         '│ pause for effect
  52.                                                 '│
  53. FOR Pl? = 0 TO 3                                '│
  54.   fGetPArr   0, 250, 99, 349, Buf%(0),    Pl?   '│ get the plane data
  55.    PutPArr 101, 250,          Buf%(0), 2, 3-Pl? '│ put back in reverse order
  56.   FOR P? = 0 TO 3                               '│ put same data to all
  57.     PutParr 202, 250, BYVAL Buf_Ptr???, 1, P?   '│ 4 planes ( 15 = white )
  58.     DELAY .3                                    '│
  59.   NEXT                                          '│ notice that the "OFF"
  60.   DELAY .5                                      '│ pixels are NOT being put
  61. NEXT                                            '│
  62. PutParr 303, 250, BYVAL Buf_Ptr???, 4, 0        '│ Pmode? = 0  AND
  63.                                                 '│ Pmode? = 1  OR
  64. WHILE NOT INSTAT : WEND                         '│ Pmode? = 2  XOR
  65. CLS                                             '│ Pmode? = 3  PSET
  66. SCREEN 0                                        '│ Pmode? = 4  PRESET
  67.                                                 '└───────────────────────────